package java3_20;

import java.util.Scanner;

public class Car_test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("金路至尊租赁有限公司欢迎您，请致电999999洽谈相关业务");
        Carbusiness cb = new Carbusiness();
        while (true){


            System.out.println("1:查看车辆情况 2:租赁 3:还车 4:报废 5:采购新车 6:退出");
            int a = scanner.nextInt();
            switch (a){
                case 1:{
                    cb.show();
                    break;
                }
                case 2:{
                    System.out.println("请输入要租赁的类型：(1.轿车/2.客车)");
                    String c = scanner.next();
                        System.out.println("现有车辆如下：");
                        cb.show(c);
                        System.out.println("请选择要租赁的车辆，请输入车牌号：");
                        String x = scanner.next();
                        cb.motoLeaseOut(x);
                        break;
                    }
                case 3:{
                    System.out.println("请输入要归还的车牌号：");
                    String h = scanner.next();
                    cb.returnCar(h);
                    break;
                }
                case 4:{
                    System.out.println("请输入要报废的车牌号：");
                    String b = scanner.next();
                    System.out.println(cb.Del(b));
                    break;
                }
                case 5:{
                      System.out.println("请输入要添加的汽车类型：(1.轿车/2.客车)");
                      String v= scanner.next();
                    if (v.equals("1")){
                      System.out.println("请输入汽车型号：");
                      String z = scanner.next();
                      System.out.println("请输入车牌号:");
                      String y = scanner.next();
                      System.out.println("请输入座位数:");
                      int b = scanner.nextInt();
                      System.out.println("请输入日租金");
                      double p = scanner.nextDouble();
                      Car car1= new Salooncar(y,p,true,b,z,"轿车");
                      boolean k =  cb.add(car1);
                        System.out.println(k);
                    }else if (v.equals("2")){
                        System.out.println("请输入汽车型号：");
                        String z = scanner.next();
                        System.out.println("请输入车牌号:");
                        String y = scanner.next();
                        System.out.println("请输入座位数:");
                        int b = scanner.nextInt();
                        System.out.println("请输入日租金");
                        double p = scanner.nextDouble();
                        boolean l = true;
                        Car car2=new Passengercar(y,p,true,b,z,"客车");
                        boolean k =  cb.add(car2);
                        System.out.println(k);
                  }
                  break;
                }
                case 6:{
                    return;
                }
            }
        }
    }
}
